package com.cimpm.permission.controller;

import com.cimpm.permission.entity.DataPermission;
import com.cimpm.permission.service.impl.DataPermissionServiceImpl;
import com.cimpm.permission.service.impl.DataPermissionTypeServiceImpl;
import com.hby.common.annotation.aspect.AutoEntityProcess;
import com.hby.common.annotation.aspect.NoEntityAutoSingleProcess;
import com.hby.common.annotation.handler.AutoRequestBody;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/dataPermission")
@CrossOrigin
public class DataPermissionController {

    @AutoEntityProcess(BUSINESS_CLASS = DataPermission.class, LOG_MSG = "DataPermission", PERMISSION_TYPE = "24")
    public Object dataPermission(@AutoRequestBody Map<String, Object> param){
        return null;
    }

    @RequestMapping("/getTypes")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = DataPermissionTypeServiceImpl.class,PARAM_FIELD = "",NO_VALID_FIELD = "",LOG_MSG = "getTypes",
                MENU_CODE = -1,PERMISSION_TYPE="5",USE_USERINFO = false)
    public Object getTypes(@AutoRequestBody Map<String, Object> param){
         return null;
    }

    @RequestMapping("/getPermsByUser")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = DataPermissionServiceImpl.class,PARAM_FIELD = "userId",NO_VALID_FIELD = "",LOG_MSG = "getPermissionsByUser",
            MENU_CODE = -1,PERMISSION_TYPE="5",USE_USERINFO = false)
    public Object getPermsByUser(@AutoRequestBody Map<String, Object> param){
        return null;
    }

    @RequestMapping("/getPermsByType")
    @NoEntityAutoSingleProcess(SERVICE_CLASS = DataPermissionServiceImpl.class,PARAM_FIELD = "permType",NO_VALID_FIELD = "",LOG_MSG = "getPermsByType",
                MENU_CODE = 1105,PERMISSION_TYPE="2",USE_USERINFO = true)
    public Object getPermsByType(@AutoRequestBody Map<String, Object> param){
         return null;
    }
}
